#include <bits/stdc++.h>
using namespace std;
int n,a[100005],q[100005],b,s,ma=-1;
int main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>b;
		ma=max(ma,b);
		a[b]++;
	}
	for(int i=1;i<=ma;i++){
		if(q[i]==0)q[i+1]=a[i];
		else if(a[i]==0)q[i+1]=q[i];
		else {
			s+=min(a[i],q[i]);
			q[i+1]=max(a[i],q[i]);
		}
	}
	cout<<n-s;
	return 0;
}
